import axios from "@/utils/request";
import Vue from "vue";

const Api = {
    getUnfinishedOrder: "/admin/unfinishedOrder",
    getAllOrder: "/admin/allOrder",
    searchOrder: "/admin/searchOrder",
    orderChange: "/admin/orderChange",
    deleteOrder: "/admin/order",
    getOrderByPage: "/admin/orderByPage",
  };

  export function getUnfinishedOrder() {
    return axios({
      url: Api.getUnfinishedOrder,
      method: "get",
    });
  }

  export function getAllOrder(parameter) {
    return axios({
      url: Api.getAllOrder,
      method: "post",
      data:parameter,
    });
  }

  export function searchOrder(parameter) {
    return axios({
      url: Api.searchOrder,
      method: "post",
      data:parameter,
    });
  }

  export function orderChange(parameter) {
    return axios({
      url: Api.orderChange,
      method: "post",
      data:parameter,
    });
  }
  
  export function deleteOrder(parameter) {
    return axios({
      url: Api.deleteOrder,
      method: "delete",
      params:parameter,
    });
  }
  
  export function getOrderByPage(parameter) {
    return axios({
      url: Api.getOrderByPage,
      method: "get",
      params:parameter,
    });
  }